package com.xuecheng.teaching.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.xuecheng.api.teaching.model.dto.WorkDTO;
import com.xuecheng.api.teaching.model.qo.QueryWorkModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.teaching.entity.Work;

import java.util.Map;

/**
 * <p>
 * 作业 服务类
 * </p>
 *
 * @author itcast
 * @since 2021-04-20
 */
public interface WorkService extends IService<Work> {

    /**
     * <p>
     * 教师添加或删除课程信息
     * </p>
     *
     * @param workDTO 作业信息封装
     * @return WorkDTO
     */
    WorkDTO createOrModifyWork(WorkDTO workDTO);


    /**
     * <p>
     *
     * </p>
     *
     * @param params
     * @param model
     * @param companyId
     * @return PageVO<WorkDTO>
     */
    PageVO<WorkDTO> queryWorkList(PageRequestParams params,
                                  QueryWorkModel model,
                                  Long companyId);

    /**
     * <p>
     * 根据作业id查询作业信息
     * </p>
     *
     * @param workId 作业id
     * @return WorkDTO
     */
    WorkDTO getWorkById(Long workId, Long companyId);

    /**
     * <p>
     * 微服务调用 查询作业信息
     * </p>
     *
     * @param workId 作业id
     * @return RestResponse<WorkDTO>
     */
    RestResponse<WorkDTO> getByWorkId(Long workId);

    /**
     * <p>
     * 删除作业
     * </p>
     *
     * @param workId    作业id
     * @param companyId 机构id
     */
    void removeWork(Long workId, Long companyId);
    /**
     * <p>
     *  提供微服务远程调用 绑定作业后修改作业信息
     * </p>
     *dada
     * @param params 参数封装 courseId cname teachplanId pname
     * @param workId 作业id
     * @return RestResponse
     */
    RestResponse modifyWorkInfo(Map<String, Object> params, Long workId);
}
